3.3.80 \(\int (a+b \sec (c+d x))^2 \tan ^4(c+d x) \, dx\) [280]

3.3.80.1 Optimal result
3.3.80.2 Mathematica [A] (verified)
3.3.80.3 Rubi [A] (verified)
3.3.80.4 Maple [A] (verified)
3.3.80.5 Fricas [A] (verification not implemented)
3.3.80.6 Sympy [F]
3.3.80.7 Maxima [A] (verification not implemented)
3.3.80.8 Giac [B] (verification not implemented)
3.3.80.9 Mupad [B] (verification not implemented)

3.3.80.1 Optimal result

Integrand size = 21, antiderivative size = 116 \[ \int (a+b \sec (c+d x))^2 \tan ^4(c+d x) \, dx=a^2 x+\frac {3 a b \text {arctanh}(\sin (c+d x))}{4 d}-\frac {a^2 \tan (c+d x)}{d}-\frac {3 a b \sec (c+d x) \tan (c+d x)}{4 d}+\frac {a^2 \tan ^3(c+d x)}{3 d}+\frac {a b \sec (c+d x) \tan ^3(c+d x)}{2 d}+\frac {b^2 \tan ^5(c+d x)}{5 d} \]

output
a^2*x+3/4*a*b*arctanh(sin(d*x+c))/d-a^2*tan(d*x+c)/d-3/4*a*b*sec(d*x+c)*ta 
n(d*x+c)/d+1/3*a^2*tan(d*x+c)^3/d+1/2*a*b*sec(d*x+c)*tan(d*x+c)^3/d+1/5*b^ 
2*tan(d*x+c)^5/d
 
3.3.80.2 Mathematica [A] (verified)

Time = 0.62 (sec) , antiderivative size = 107, normalized size of antiderivative = 0.92 \[ \int (a+b \sec (c+d x))^2 \tan ^4(c+d x) \, dx=\frac {60 a^2 \arctan (\tan (c+d x))+45 a b \text {arctanh}(\sin (c+d x))+\tan (c+d x) \left (-90 a b \sec ^3(c+d x)+15 a b \sec (c+d x) \left (3+8 \tan ^2(c+d x)\right )+4 \left (-15 a^2+5 a^2 \tan ^2(c+d x)+3 b^2 \tan ^4(c+d x)\right )\right )}{60 d} \]

input
Integrate[(a + b*Sec[c + d*x])^2*Tan[c + d*x]^4,x]
 
output
(60*a^2*ArcTan[Tan[c + d*x]] + 45*a*b*ArcTanh[Sin[c + d*x]] + Tan[c + d*x] 
*(-90*a*b*Sec[c + d*x]^3 + 15*a*b*Sec[c + d*x]*(3 + 8*Tan[c + d*x]^2) + 4* 
(-15*a^2 + 5*a^2*Tan[c + d*x]^2 + 3*b^2*Tan[c + d*x]^4)))/(60*d)
 
3.3.80.3 Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 4374, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \tan ^4(c+d x) (a+b \sec (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \cot \left (c+d x+\frac {\pi }{2}\right )^4 \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2dx\)

\(\Big \downarrow \) 4374

\(\displaystyle \int \left (a^2 \tan ^4(c+d x)+2 a b \tan ^4(c+d x) \sec (c+d x)+b^2 \tan ^4(c+d x) \sec ^2(c+d x)\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a^2 \tan ^3(c+d x)}{3 d}-\frac {a^2 \tan (c+d x)}{d}+a^2 x+\frac {3 a b \text {arctanh}(\sin (c+d x))}{4 d}+\frac {a b \tan ^3(c+d x) \sec (c+d x)}{2 d}-\frac {3 a b \tan (c+d x) \sec (c+d x)}{4 d}+\frac {b^2 \tan ^5(c+d x)}{5 d}\)

input
Int[(a + b*Sec[c + d*x])^2*Tan[c + d*x]^4,x]
 
output
a^2*x + (3*a*b*ArcTanh[Sin[c + d*x]])/(4*d) - (a^2*Tan[c + d*x])/d - (3*a* 
b*Sec[c + d*x]*Tan[c + d*x])/(4*d) + (a^2*Tan[c + d*x]^3)/(3*d) + (a*b*Sec 
[c + d*x]*Tan[c + d*x]^3)/(2*d) + (b^2*Tan[c + d*x]^5)/(5*d)
 

3.3.80.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4374
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( 
a_))^(n_), x_Symbol] :> Int[ExpandIntegrand[(e*Cot[c + d*x])^m, (a + b*Csc[ 
c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 0]
 
3.3.80.4 Maple [A] (verified)

Time = 2.36 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.11

method result size
derivativedivides \(\frac {a^{2} \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+d x +c \right )+2 a b \left (\frac {\sin \left (d x +c \right )^{5}}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin \left (d x +c \right )^{5}}{8 \cos \left (d x +c \right )^{2}}-\frac {\sin \left (d x +c \right )^{3}}{8}-\frac {3 \sin \left (d x +c \right )}{8}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {b^{2} \sin \left (d x +c \right )^{5}}{5 \cos \left (d x +c \right )^{5}}}{d}\) \(129\)
default \(\frac {a^{2} \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+d x +c \right )+2 a b \left (\frac {\sin \left (d x +c \right )^{5}}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin \left (d x +c \right )^{5}}{8 \cos \left (d x +c \right )^{2}}-\frac {\sin \left (d x +c \right )^{3}}{8}-\frac {3 \sin \left (d x +c \right )}{8}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {b^{2} \sin \left (d x +c \right )^{5}}{5 \cos \left (d x +c \right )^{5}}}{d}\) \(129\)
parts \(\frac {a^{2} \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {b^{2} \tan \left (d x +c \right )^{5}}{5 d}+\frac {2 a b \left (\frac {\sin \left (d x +c \right )^{5}}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin \left (d x +c \right )^{5}}{8 \cos \left (d x +c \right )^{2}}-\frac {\sin \left (d x +c \right )^{3}}{8}-\frac {3 \sin \left (d x +c \right )}{8}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(129\)
risch \(a^{2} x +\frac {i \left (75 a b \,{\mathrm e}^{9 i \left (d x +c \right )}-120 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}+60 b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+30 a b \,{\mathrm e}^{7 i \left (d x +c \right )}-360 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}-440 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+120 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-30 a b \,{\mathrm e}^{3 i \left (d x +c \right )}-280 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-75 a b \,{\mathrm e}^{i \left (d x +c \right )}-80 a^{2}+12 b^{2}\right )}{30 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}+\frac {3 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{4 d}-\frac {3 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{4 d}\) \(213\)

input
int((a+b*sec(d*x+c))^2*tan(d*x+c)^4,x,method=_RETURNVERBOSE)
 
output
1/d*(a^2*(1/3*tan(d*x+c)^3-tan(d*x+c)+d*x+c)+2*a*b*(1/4*sin(d*x+c)^5/cos(d 
*x+c)^4-1/8*sin(d*x+c)^5/cos(d*x+c)^2-1/8*sin(d*x+c)^3-3/8*sin(d*x+c)+3/8* 
ln(sec(d*x+c)+tan(d*x+c)))+1/5*b^2*sin(d*x+c)^5/cos(d*x+c)^5)
 
3.3.80.5 Fricas [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.30 \[ \int (a+b \sec (c+d x))^2 \tan ^4(c+d x) \, dx=\frac {120 \, a^{2} d x \cos \left (d x + c\right )^{5} + 45 \, a b \cos \left (d x + c\right )^{5} \log \left (\sin \left (d x + c\right ) + 1\right ) - 45 \, a b \cos \left (d x + c\right )^{5} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (75 \, a b \cos \left (d x + c\right )^{3} + 4 \, {\left (20 \, a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{4} - 30 \, a b \cos \left (d x + c\right ) - 4 \, {\left (5 \, a^{2} - 6 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 12 \, b^{2}\right )} \sin \left (d x + c\right )}{120 \, d \cos \left (d x + c\right )^{5}} \]

input
integrate((a+b*sec(d*x+c))^2*tan(d*x+c)^4,x, algorithm="fricas")
 
output
1/120*(120*a^2*d*x*cos(d*x + c)^5 + 45*a*b*cos(d*x + c)^5*log(sin(d*x + c) 
 + 1) - 45*a*b*cos(d*x + c)^5*log(-sin(d*x + c) + 1) - 2*(75*a*b*cos(d*x + 
 c)^3 + 4*(20*a^2 - 3*b^2)*cos(d*x + c)^4 - 30*a*b*cos(d*x + c) - 4*(5*a^2 
 - 6*b^2)*cos(d*x + c)^2 - 12*b^2)*sin(d*x + c))/(d*cos(d*x + c)^5)
 
3.3.80.6 Sympy [F]

\[ \int (a+b \sec (c+d x))^2 \tan ^4(c+d x) \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \tan ^{4}{\left (c + d x \right )}\, dx \]

input
integrate((a+b*sec(d*x+c))**2*tan(d*x+c)**4,x)
 
output
Integral((a + b*sec(c + d*x))**2*tan(c + d*x)**4, x)
 
3.3.80.7 Maxima [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.02 \[ \int (a+b \sec (c+d x))^2 \tan ^4(c+d x) \, dx=\frac {24 \, b^{2} \tan \left (d x + c\right )^{5} + 40 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} a^{2} + 15 \, a b {\left (\frac {2 \, {\left (5 \, \sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} + 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{120 \, d} \]

input
integrate((a+b*sec(d*x+c))^2*tan(d*x+c)^4,x, algorithm="maxima")
 
output
1/120*(24*b^2*tan(d*x + c)^5 + 40*(tan(d*x + c)^3 + 3*d*x + 3*c - 3*tan(d* 
x + c))*a^2 + 15*a*b*(2*(5*sin(d*x + c)^3 - 3*sin(d*x + c))/(sin(d*x + c)^ 
4 - 2*sin(d*x + c)^2 + 1) + 3*log(sin(d*x + c) + 1) - 3*log(sin(d*x + c) - 
 1)))/d
 
3.3.80.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 220 vs. \(2 (106) = 212\).

Time = 1.04 (sec) , antiderivative size = 220, normalized size of antiderivative = 1.90 \[ \int (a+b \sec (c+d x))^2 \tan ^4(c+d x) \, dx=\frac {60 \, {\left (d x + c\right )} a^{2} + 45 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 45 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (60 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 45 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 320 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 210 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 520 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 192 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 320 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 210 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 60 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 45 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{5}}}{60 \, d} \]

input
integrate((a+b*sec(d*x+c))^2*tan(d*x+c)^4,x, algorithm="giac")
 
output
1/60*(60*(d*x + c)*a^2 + 45*a*b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 45*a* 
b*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(60*a^2*tan(1/2*d*x + 1/2*c)^9 - 
45*a*b*tan(1/2*d*x + 1/2*c)^9 - 320*a^2*tan(1/2*d*x + 1/2*c)^7 + 210*a*b*t 
an(1/2*d*x + 1/2*c)^7 + 520*a^2*tan(1/2*d*x + 1/2*c)^5 - 192*b^2*tan(1/2*d 
*x + 1/2*c)^5 - 320*a^2*tan(1/2*d*x + 1/2*c)^3 - 210*a*b*tan(1/2*d*x + 1/2 
*c)^3 + 60*a^2*tan(1/2*d*x + 1/2*c) + 45*a*b*tan(1/2*d*x + 1/2*c))/(tan(1/ 
2*d*x + 1/2*c)^2 - 1)^5)/d
 
3.3.80.9 Mupad [B] (verification not implemented)

Time = 15.41 (sec) , antiderivative size = 332, normalized size of antiderivative = 2.86 \[ \int (a+b \sec (c+d x))^2 \tan ^4(c+d x) \, dx=\frac {\left (2\,a^2-\frac {3\,a\,b}{2}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (7\,a\,b-\frac {32\,a^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {52\,a^2}{3}-\frac {32\,b^2}{5}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-\frac {32\,a^2}{3}-7\,b\,a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,a^2+\frac {3\,b\,a}{2}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}+\frac {2\,a^2\,\mathrm {atan}\left (\frac {64\,a^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^6+36\,a^4\,b^2}+\frac {36\,a^4\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^6+36\,a^4\,b^2}\right )}{d}+\frac {3\,a\,b\,\mathrm {atanh}\left (\frac {48\,a^5\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{48\,a^5\,b+27\,a^3\,b^3}+\frac {27\,a^3\,b^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{48\,a^5\,b+27\,a^3\,b^3}\right )}{2\,d} \]

input
int(tan(c + d*x)^4*(a + b/cos(c + d*x))^2,x)
 
output
(tan(c/2 + (d*x)/2)^5*((52*a^2)/3 - (32*b^2)/5) - tan(c/2 + (d*x)/2)^9*((3 
*a*b)/2 - 2*a^2) - tan(c/2 + (d*x)/2)^3*(7*a*b + (32*a^2)/3) + tan(c/2 + ( 
d*x)/2)^7*(7*a*b - (32*a^2)/3) + tan(c/2 + (d*x)/2)*((3*a*b)/2 + 2*a^2))/( 
d*(5*tan(c/2 + (d*x)/2)^2 - 10*tan(c/2 + (d*x)/2)^4 + 10*tan(c/2 + (d*x)/2 
)^6 - 5*tan(c/2 + (d*x)/2)^8 + tan(c/2 + (d*x)/2)^10 - 1)) + (2*a^2*atan(( 
64*a^6*tan(c/2 + (d*x)/2))/(64*a^6 + 36*a^4*b^2) + (36*a^4*b^2*tan(c/2 + ( 
d*x)/2))/(64*a^6 + 36*a^4*b^2)))/d + (3*a*b*atanh((48*a^5*b*tan(c/2 + (d*x 
)/2))/(48*a^5*b + 27*a^3*b^3) + (27*a^3*b^3*tan(c/2 + (d*x)/2))/(48*a^5*b 
+ 27*a^3*b^3)))/(2*d)